home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #Tag 0x9085
-
- #**************************************************************************
- #* *
- #* Copyright (c) 1996 Silicon Graphics, Inc. *
- #* All Rights Reserved *
- #* *
- #* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
- #* *
- #* The copyright notice above does not evidence any actual of intended *
- #* publication of such source code, and is an unpublished work by Silicon *
- #* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
- #* the property of Silicon Graphics, Inc. Any use, duplication or *
- #* disclosure not specifically authorized by Silicon Graphics is strictly *
- #* prohibited. *
- #* *
- #* RESTRICTED RIGHTS LEGEND: *
- #* *
- #* Use, duplication or disclosure by the Government is subject to *
- #* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
- #* Technical Data and Computer Software clause at DFARS 52.227-7013, *
- #* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
- #* Supplement. Unpublished - rights reserved under the Copyright Laws of *
- #* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
- #* Shoreline Blvd., Mountain View, CA 94039-7311 *
- #**************************************************************************
-
- # Where do we want to go
- URL="file:/usr/demos/General_Demos/boink/data/intro.html"
-
- #
- # Default place to start up Netscape at,
- # currently assuming a 1280x1024 display
- #
- #GEOMETRY should be of the form "1250x970+15+0"
- GEOMETRY="1250x970+15+0"
-
- DISPLAY="localhost:0.0"; export DISPLAY
- NETSCAPE_3PREF="/usr/demos/Demo_Interfaces/Web/common/preferences"
- NETSCAPE_4PREF="/usr/demos/Demo_Interfaces/Web/common/preferences.js"
- NETSCAPE_4XDEFAULTS="/usr/demos/Demo_Interfaces/Web/common/Xdefaults"
-
- remove_lock() {
- if [ -l $HOME/.netscape/lock ]
- then
- rm $HOME/.netscape/lock
- fi
- }
-
- launch_ns4() {
- remove_lock
- #
- # netscape4 currently (beta) does not take -geometry or -xrm don't use it.
- #
- # netscape4 will respect an xrdb info with absolute
- # positioning, so get the old value, use desired value and return
- # xrdb to either default or previous setting.
- #
- XRDBNSG=`xrdb -q | fgrep -i netscape | fgrep -i geometry`
- echo "Netscape.Navigator.geometry: =$GEOMETRY" | xrdb -override
- /usr/bin/X11/netscape $URL &
- sleep 20 # Time so netscape can start up
- if [ -z "$XRDBNSG" ]
- then
- if [ "$USER" = "demos" ]
- then
- # demos default Netscape geometry is 720x887
- echo "Netscape.Navigator.geometry: =835x942" | xrdb -override
- else
- # Netsape's default geometry is 720x887
- echo "Netscape.Navigator.geometry: =720x887" | xrdb -override
- fi
- else
- echo $XRDBNSG |xrdb -override
- fi
-
- }
-
- launch_ns3() {
- remove_lock
- #
- # since .Xdefaults overrides Netscape's -geometry option
- # we have to use -xrm which overrides .Xdefaults, the demos account provides
- # an Xdefaults file so that Netscape is a little larger than normal.
- # Some users may have specified Netscape geometry in their Xdefaults file.
- # So do the right thing and specify what we want
- #
- /usr/bin/X11/netscape -xrm "Netscape.Navigator.geometry: $GEOMETRY" $URL &
- }
-
- # Assuming Navigator is 3.X and Communicator is 4.X
- NSVERSION=`showprods -D1 netscape netscape_gold |egrep "Navigator|Communicator"`
-
- case "$NSVERSION" in
-
- *Communicator*)
- # If USER null, assume script is being run from the Web Interface
- # under the USER name as nobody. So we need to set up a fake home
- # directory, else run netscape4
- if [ -z "$USER" ]
- then
- HOME="/tmp/nobodyNetscapeHome" ; export HOME
- if [ ! -d $HOME ]
- then
- mkdir -p $HOME/.netscape/cache $HOME/.netscape/archive
- # the preferences file has browser width and height which
- # netscape 4 will respect, but no way for absolute positioning
- # in the preferences
- if [ -f $NETSCAPE_4PREF ]
- then
- cp $NETSCAPE_4PREF $HOME/.netscape
- fi
- launch_ns4
-
- # If $HOME is set up check to see if it has the old preferences file and replace it
- else
- if [ -f $HOME/.netscape/preferences ]
- then
- rm $HOME/.netscape/preferences
- fi
- if [ ! -f $HOME/.netscape/preferences.js ]
- then
- if [ -f $NETSCAPE_4PREF ]
- then
- cp $NETSCAPE_4PREF $HOME/.netscape
- fi
- fi
- launch_ns4
- fi
- else
- launch_ns4
- fi
- ;;
-
- # If not Communicator then at least try Netscape with Navigator's environment
- *Navigator*|*)
- # If USER null, assume script is being run from the Web Interface
- # under the USER name as nobody. So we need to set up a fake home
- # directory.
- if [ -z "$USER" ]
- then
- HOME="/tmp/nobodyNetscapeHome" ; export HOME
- if [ ! -d $HOME ]
- then
- mkdir -p $HOME/.netscape/cache
- if [ -f $NETSCAPE_3PREF ]
- then
- cp $NETSCAPE_3PREF $HOME/.netscape
- fi
- fi
- launch_ns3
-
- # If USER is set then assume this script was run from the desktop
- # Either demos or another user
- else
- launch_ns3
- fi
- ;;
-
- esac
-